home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntinc20 / sysvars.h < prev    next >
C/C++ Source or Header  |  1992-05-15  |  5KB  |  132 lines

  1. /* definitions for various GEMDOS system variables in low memory */
  2. /* WARNING: this file is not compatible with the old one */
  3.  
  4. /*
  5.  * Convention:
  6.  *     the address for each variable is defined.
  7.  */
  8. #ifndef _SYSVARS_H
  9. #define _SYSVARS_H
  10.  
  11. #ifndef _COMPILER_H
  12. #include <compiler.h>
  13. #endif
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19.  
  20. /* Processor state and post mortem dump area */
  21.  
  22. #define PROC_LIVES_MAGIC 0x12345678L    /* proc_lives if dump is valid */
  23. #define proc_lives    ((unsigned long *) 0x380L)
  24. struct __post_mortem_dump {
  25.     unsigned long    d0, d1, d2, d3, d4, d5, d6, d7;
  26.     void           *a0, *a1, *a2, *a3, *a4, *a5, *a6, *a7; /* a7 == ssp */
  27.     void        *pc;      /* first byte is exception #   */
  28.     void        *usp;
  29.     unsigned short    stk[16];  /* sixteen word of super stack */
  30. };
  31. #define proc_post_mortem_dump_p    ((struct __post_mortem_dump *) 0x384L)
  32. #define proc_dregs    (&proc_post_mortem_dump_p->d0)
  33. #define proc_aregs    (&proc_post_mortem_dump_p->a0)
  34. #define proc_pc        (proc_post_mortem_dump_p->pc)
  35. #define proc_usp    (proc_post_mortem_dump_p->usp)
  36. #define proc_utk    (proc_post_mortem_dump_p->stk)
  37.  
  38.  
  39. /* timer, crit error and process termination handoff vectors */
  40. #define etv_timer    (((void (**)()) 0x400L))
  41. #define etv_critic    (((void (**)()) 0x404L))
  42. #define etv_term    (((void (**)()) 0x408L))
  43.  
  44. /* memory controller */
  45. #define MEMVALID_MAGIC    0x752019F3L    /* once memory is sized */
  46. #define memvalid    (((unsigned long *) 0x420L))
  47. #define mencntlr    (((unsigned char *) 0x424L))
  48.              /* 0 = 128K, 4 = 512K 0 = 256k(2banks) 5 = 1M */
  49.  
  50. /* reset vector, jump through resvector if resvalid on reset */
  51. #define RESVALID_MAGIC    0x31415926L
  52. #define resvalid    ((unsigned long *) 0x426L)
  53. #define resvector    ((void (**)())     0x42aL)
  54.             /* do a jmp 0x24L(a6) at end to go to system reset */
  55.  
  56. /* mem */
  57. #define phystop        (((unsigned long *) 0x42eL)) /* physical top of ram */
  58. #define _membot        (((unsigned long *) 0x432L)) /* bottom of avail     */
  59. #define _memtop        (((unsigned long *) 0x436L)) /* top    of avail     */
  60. #define MEMVAL2_MAGIC    0x237698AAL /* after suc. coldstart && memvalid     */
  61. #define memval2        (((unsigned long *) 0x43aL)) 
  62.  
  63. /* floppy */
  64. #define flock        (((short *) 0x43eL)) /* lock usage of DMA   chip */
  65. #define seekrate    (((short *) 0x440L)) /* 0=6ms 1=12ms 2=2ms 3=3ms */
  66. #define _timr_ms    (((short *) 0x442L)) /* timer calib == 20ms      */
  67. #define _fverify    (((short *) 0x444L)) /* write verify flag        */
  68. #define _bootdev    (((short *) 0x446L))
  69.  
  70. /* video */
  71. #define palmode        (((short *) 0x448L)) /* PAL video mode flag         */
  72. #define defshiftmd    (((unsigned char *) 0x44aL)) /* default video rez   */
  73. #define sshiftmd    (((short *) 0x44cL)) /* shadow of hdwr. shiftmd reg */
  74.                           /* 0=Lo 1=med 2=Hi rez         */
  75. #define _v_bas_ad    (((void *) 0x44eL))  /* screen mem base             */
  76. #define vblsem        ((short *) 0x452L))  /* vbl semaphore               */
  77. #define nvbls        (((short *) 0x454L)) /* # of vbl entries def. == 8  */
  78. #define _vblqueue    (((void (***)()) 0x456L)) /* vbl queue pointer      */
  79. #define colorptr    (((short **) 0x45aL)) /* pal. on next vblank if!NULL */
  80. #define _vbclock    (((unsigned long *) 0x462L)) /* vbi counter         */
  81. #define _frclock        (((unsigned long *) 0x466L)) /* #vbi not vblsem'ed  */
  82.  
  83. #define _hz_200        ((unsigned long *) 0x4baL)
  84.  
  85. #define conterm        (*((char *) 0x484L))
  86. #define savptr        ((long *) 0x4A2L)
  87. #define _nflops        ((short *) 0x4A6L)
  88. #define _sysbase    ((long *) 0x4F2L)
  89. #define _shell_p    ((long *) 0x4F6L)
  90.  
  91. typedef struct {
  92.   short    puns;
  93.   char    v_p_un[16];
  94.   long    pstart[16];
  95.   short    bpbs[1];        /* really 16 BPB's (bios parameter block) */
  96. } HDINFO;
  97.  
  98. #define pun_ptr        ((HDINFO *) 0x516L)
  99. #define _p_cookies    ((long **) 0x5A0L)
  100.  
  101. /* os header */
  102. typedef struct _osheader 
  103. {
  104.     unsigned short    os_entry;        /* 0x00  BRA to reset handler    */
  105.     unsigned short    os_version;      /* 0x02  TOS version        */
  106.     void        (*reseth) __PROTO((void)); /* 0x04 -> reset handler    */
  107.     struct _osheader    *os_beg;     /* 0x08 -> base of OS        */
  108.     void        *os_end;     /* 0x0c -> end of OS ram usage */
  109.     char        *os_rsv1;     /* 0x10 reserved        */
  110.     char        *os_magic;     /* 0x14 GEM memory usage param */
  111.     long        os_date;     /* 0x18 Build date 0xMMDDYYYY    */
  112.     unsigned short    os_conf;     /* 0x1c OS conf bits        */
  113.     unsigned short    os_dosdate;     /* 0x1e DOS format build date  */
  114.     /* the following available on TOS version >= 1.2 */
  115.     char        **p_root;     /* 0x20 -> base of OS pool    */
  116.     char        **pkbshift;     /* 0x24 -> kbd shift state var */
  117.     char        **p_run;     /* 0x28 -> PID of current proc */
  118.     char        *p_rsv2;     /* 0x2c reserved        */
  119. } OSHEADER;
  120.     
  121. /* zzzz to-do more */
  122.  
  123. __EXTERN long    get_sysvar        __PROTO((void *var));
  124. __EXTERN void    set_sysvar_to_long    __PROTO((void *var, long val));
  125.  
  126.  
  127. #ifdef __cplusplus
  128. }
  129. #endif
  130.  
  131. #endif /* _SYSVARS_H */
  132.